#!/bin/bash
# -*-Shell-script-*-
#
# Desktop-cherry, Configure your Fedora in a friendly maner.
#
# Copyright (C) 2007,2008 Globaltek - Solucoes Informaticas, Lda.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# Contact the author at: Rui Gouveia <rui.gouveia(_at_)globaltek.pt>
# 

################################
# Target distro

RELEASE='10'
SCRIPT_DISTRO="Fedora $RELEASE"
SCRIPT_VERSION='0.10.1'

SCRIPT_PATH=`pwd`

#############################################################################
## Prep

# yum debug level.
yum_debug=2

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
if [ ${NETWORKING} = "no" ]; then
    echo "Network offline. Try again..."
    exit 0
fi

# Check if we are root?
if [ "$UID" != 0 ]; then
    echo "You are not root. Please run me as root. Thanks."
    exit 0
fi

# Check if we are running in the proper distro version.
if ! grep -q "Fedora release $RELEASE" /etc/redhat-release; then 
    echo "This script is intended for the Fedora $RELEASE only..."
    exit 0
fi

#############################################################################
## Generic function to install several packages at once.

function _install () {
    rpms=$1

    install=0
    for rpm in $rpms; do
	if [ "$install" == "0" ]; then
	    echo "Checking $rpm..."
	    if ! rpm --quiet -q $rpm; then
		    install=1
	    fi
	fi
    done

    if [ "$install" == "0" ]; then
	echo 'Listed software already installed'
	echo
    else
	echo "Installing software: $rpms"
	yum -d $yum_debug -y install $rpms
    fi
}

#############################################################################
## Disable SELINUX

function sys_selinux () {

    echo -e "\n##################################################"
    echo -e "# Disable selinux\n"

    if [ `/usr/sbin/getenforce` != "Disabled" ]; then
        echo "Disabling SELINUX..."
        sed -i.bak \
            -e 's/^SELINUX=.*$/SELINUX=disabled/' \
            /etc/selinux/config

	echo 'SELinux is disabled. A Reboot is necessary for the new'
	echo 'configuration to become active... at your time. No rush.'
    else
        echo 'SELinux already disabled. Skipping.'
    fi
}

#############################################################################
## Configure fsck to run automaticaly on cold shutdown

function sys_autofsck () {

    echo -e "\n##################################################"
    echo -e "# Autofsck\n"

    if [ ! -f /etc/sysconfig/autofsck ]; then
        cat<<EOF> /etc/sysconfig/autofsck
AUTOFSCK_DEF_CHECK=yes
PROMPT=no
EOF
        echo 'AUTO FSCK Enabled.'
    else
        echo 'File /etc/sysconfig/autofsck already exists. No change.'
    fi    
}

#############################################################################
## Configure services.

function sys_services () {

    echo -e "\n##################################################"
    echo -e "# System Services\n"

    chkconfig NetworkManager on
    chkconfig anacron on
    chkconfig atd on
    chkconfig auditd on
    chkconfig avahi-daemon on
    chkconfig bluetooth off
    chkconfig cpuspeed on
    chkconfig crond on
    chkconfig cups on
    chkconfig dhcdbd off
    chkconfig dnsmasq on
    chkconfig gpm on
    chkconfig haldaemon on
    chkconfig hidd off
    chkconfig irda off
    chkconfig irqbalance on
    chkconfig isdn off
    chkconfig kerneloops on
    chkconfig lm_sensors on
    chkconfig mdmonitor off
    chkconfig messagebus on
    chkconfig microcode_ctl on
    chkconfig multipathd off
    chkconfig mdmonitor off
    chkconfig mcstrans off
    chkconfig nasd off
    chkconfig netfs off
    chkconfig nfslock off
    chkconfig network off
    chkconfig pcscd off
    chkconfig portmap off
    chkconfig portreserve off
    chkconfig postfix off
    chkconfig restorecond off
    chkconfig rpcbind off
    chkconfig rpcgssd off
    chkconfig rpcidmapd off
    chkconfig rpcsvcgssd off
    chkconfig rsyslog on
    chkconfig saslauthd off
    chkconfig sendmail off
    chkconfig setroubleshoot off
    chkconfig smartd on
    chkconfig smolt on
    chkconfig sshd on
    chkconfig udev-post on
    chkconfig vncserver off
    chkconfig winbind off
    chkconfig ypbind off
    chkconfig yum-updateonboot off
    chkconfig yum-updatesd on

    echo -e "\nServices configured. You may have to restart this host in order to apply the changes..."
}

#############################################################################
# Configure logrotate.conf

function sys_logrotate () {

    echo -e "\n##################################################"
    echo -e "# Syslog rotate\n"

    if [ -f /etc/logrotate.conf.bak ]; then
        echo 'Logrotate already configured. Skipping...'
    else
        sed -i.bak \
            -e 's/^#compress/compress/' \
            /etc/logrotate.conf

        echo 'Logrotate configured.'
    fi
}

#############################################################################
# Configure yum-updatesd.conf

function sys_yum_updatesd () {

    echo -e "\n##################################################"
    echo -e "# yum updates daemon\n"

    if [ -f /etc/yum/yum-updatesd.conf.bak ]; then
	echo 'yum-updatesd.conf already configured. Skipping...'
    else
	if [ ! -f /etc/yum/yum-updatesd.conf ]; then
	    yum -d $yum_debug -y install yum-updatesd
	fi

	echo 'Configure yum-updatesd.conf...'
	
	sed -i.bak \
	    -e 's/^run_interval =.*/run_interval = 43200/' \
	    -e 's/^emit_via =.*/emit_via = syslog/' \
	    -e 's/^do_update =.*/do_update = yes/' \
	    -e 's/^do_download =.*/do_download = yes/' \
	    -e 's/^do_download_deps =.*/do_download_deps = yes/' \
	    /etc/yum/yum-updatesd.conf
    fi
}

#############################################################################
# Miscellaneous configs

function sys_misc () {

    echo -e "\n##################################################"
    echo -e "# System miscellaneous configs\n"

    echo
    echo -n 'Do you want to disable IPV6? [yes]: '
    read answer

    if [ "$answer" == "yes" ] || [ "$answer" == "" ]; then
        if ! grep -q "blacklist ipv6" /etc/modprobe.conf; then
            cat<<EOF>>/etc/modprobe.conf
# disable IPV6
blacklist ipv6
EOF
            sed -i.bak \
                -e 's/^NETWORKING_IPV6=.*/NETWORKING_IPV6=no/' \
                /etc/sysconfig/network
            chkconfig ip6tables off
        fi
    fi

    echo
    echo -n 'Do you want to enable Kernel System Request? [yes]: '
    read answer

    if [ "$answer" == "yes" ] || [ "$answer" == "" ]; then
        sed -i.bak \
            -e 's/kernel.sysrq =.*/kernel.sysrq = 1/' \
            /etc/sysctl.conf
    fi

    echo
    echo -n 'Do you want to enable ssh X11 forward? [yes]: '
    read answer

    if [ "$answer" == "yes" ] || [ "$answer" == "" ]; then
        sed -i.bak \
            -e 's/#.*ForwardX11.*/ForwardX11 yes\nForwardX11Trusted yes/' \
            /etc/ssh/ssh_config
    fi
}

#############################################################################
## Update

function update () {

    echo -e "\n##################################################"
    echo -e "# System Update\n"
    
    echo -n 'Do you want YUM to install packages automatically (yum will stop asking for confirmation)? [yes]: '
    read answer
    
    if [ "$answer" == "yes" ] || [ "$answer" == "" ]; then
	if ! grep -q assumeyes /etc/yum.conf ; then
	    sed -i.bak \
	        -e 's/.*metadata.*/&\nassumeyes=1/' \
		/etc/yum.conf
	fi
    fi

    echo -e "\n\n##################################################"
    echo -e "# Checking for yum update...\n"
    yum -d $yum_debug update yum

    echo -e "\n\n##################################################"
    echo -e "# Installing yum plugins...\n"
    yum -d $yum_debug install \
	yum-presto \
	yum-NetworkManager-dispatcher \
	yum-aliases \
	yum-fedorakmod \
	yum-kernel-module \
	yum-keys \
	yum-priorities \
	yum-refresh-updatesd \
	yum-remove-with-leaves \
	yum-security \
	yum-updatesd \
	yum-upgrade-helper \
	yum-verify \
	yum-versionlock

    echo -e "\n\n##################################################"
    echo -e "# Importing rpm gpg keys...\n"
    rpm --import /etc/pki/rpm-gpg/*

    echo -e "\n\n##################################################"
    echo -e "# Updating the system... this may take a while...\n"
    yum -d $yum_debug update
}

#############################################################################
# Installing aditional repos

function sys_repos () {

    echo -e "\n##################################################"
    echo -e "# Additional repositories\n"

    echo -e "\n# RPM Fusion..."

    if [ ! -f /etc/yum.repos.d/rpmfusion-free.repo ]; then
	echo 'Installing RPM Fusion Free repo...'
	rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
	rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora

	echo 'Installing RPM Fusion Nonfree repo...'
	rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
	rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-nonfree-fedora
    else
	echo 'RPM Fusion repos already installed.'
    fi
    

    echo -e "\n# Flash Player..."

    # Flash Player
    if ! [ -f /etc/yum.repos.d/adobe-linux-i386.repo ]; then
	echo 'Installing Flash Player repo...'
	rpm -Uvh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm
        rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
    else
	echo 'Flash Player repo already installed.'
    fi
    

    echo -e "\n# Freshrpms (libdvdcss only)..."
    
    # Freshrpms
    if [ ! -f /etc/yum.repos.d/freshrpms.repo ]; then
        echo 'Installing Freshrpms repo'
        rpm --import http://freshrpms.net/RPM-GPG-KEY-freshrpms
        rpm -Uvh http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/10/freshrpms-release/freshrpms-release-1.2-1.noarch.rpm
    else
	echo 'Freshrpms repo already installed.'
    fi


    echo -e "\n# Google repo..."

    # Google
    if [ ! -f /etc/yum.repos.d/google.repo ]; then
        echo 'Installing Google repo'
        rpm --import https://dl-ssl.google.com/linux/linux_signing_key.pub
        cat<<EOF>/etc/yum.repos.d/google.repo
[google]
name=Google - i386
baseurl=http://dl.google.com/linux/rpm/stable/i386
enabled=1
gpgcheck=1
EOF
    else
    	echo 'Google repo already installed.'
    fi
}

#############################################################################
# Flash Player - http://adobe.com/

function flash_player () {

    echo -e "\n##################################################"
    echo -e "# Flash Player\n"

    if [ ! -f /etc/yum.repos.d/adobe-linux-i386.repo ]; then
	echo 'Repo Adobe repo not installed. Install repos first.'
    else
	if [ ! -f /usr/lib/flash-plugin/libflashplayer.so ]; then
	    echo 'Installing Flash Player...'
	    yum -d $yum_debug -y install flash-plugin
	else
	    echo 'Flash Player already installed. Skipping'
	fi
    fi
}

#############################################################################
# Adobe reader - www.adobe.com

function acrobat_reader () {

    echo -e "\n##################################################"
    echo -e "# Acrobat Reader\n"

    if [ ! -f /usr/bin/acroread ]; then
	
	echo 'In which language do you want to install Adobe Acrobat Reader? You can only have one version.'
	echo 'For example: type enu for english or ptb for portuguese.'
	echo -n 'Options: chs, cht, dan, deu, enu, esp, fra, ita, jpn, kor, nld, nor, ptb, suo, sve : '
	read lang

	yum -d $yum_debug -y install AdobeReader_$lang
    else
        echo 'Adobe Acrobat Reader already installed. Skipping...'
    fi
}

#############################################################################
## Aditional software

function extras () {
 
    echo -e "\n##################################################"
    echo -e "# Additional software\n"

    RPMS="pidgin filezilla gwget thunderbird ncftp empathy epiphany"
    echo
    echo $RPMS
    echo
    echo -n 'Do you want to install addictional graphical internet software? [yes]: '
    read answer

    if [ "$answer" == "yes" ] || [ "$answer" == "" ]; then
	_install "$RPMS"
    fi

    # Install needed software for multimedia.
    echo 'Installing mandatory multimedia packages...'
    RPMS="ffmpeg lame libdvdcss libdvdnav libdvbpsi"
    _install "$RPMS"

    # Gnome only!
    RPMS="rhythmbox pidgin-rhythmbox \
totem totem-gstreamer totem-mozplugin totem-nautilus totem-pl-parser totem-xine totem-galago totem-publish totem-tracker totem-youtube \
mplayer mplayer-gui gnome-mplayer \
xine xine-lib xine-lib-extras xine-lib-extras-freeworld gxine-mozplugin xine-lib-pulseaudio xine-plugin \
vlc vlc-core mozilla-vlc \
vorbis-tools flac oggconvert oggvideotools vorbisgain \
amule bittorrent bittorrent-gui"

    echo 
    echo $RPMS
    echo
    echo -n 'Do you want to install sound and video software for Gnome? [yes]: '
    read answer

    if [ "$answer" == "yes" ] || [ "$answer" == "" ]; then
	_install "$RPMS"
    fi

    # KDE only
    RPMS="amarok amarokFS \
k3b k3b-extras-freeworld \
kdemultimedia-extras-nonfree \
ktorrent"

    echo 
    echo $RPMS
    echo
    echo -n 'Do you want to install sound and video software for KDE? [yes]: '
    read answer

    if [ "$answer" == "yes" ] || [ "$answer" == "" ]; then
	_install "$RPMS"
    fi


    # Define some system-wide config for mplayer
#    if [ ! -f /etc/skel/.mplayer/config ]; then
#        mkdir /etc/skel/.mplayer
#        cat<<EOF>/etc/skel/.mplayer/config
#vo=xv
#ao=alsa
#EOF
#    fi

}

#############################################################################
# Opera www.opera.com

function opera () {

    echo -e "\n##################################################"
    echo -e "# Opera\n"

    if [ ! -f /usr/bin/opera ]; then
	#echo 'Installing deps...'
	#yum -d $yum_debug -y install compat-libstdc++-33 compat-libstdc++-296
        #/sbin/ldconfig
	
	FILE=`ls -d1 opera-*.rpm`
    	if [ "$FILE" == "" ]; then
	    echo 'Downloading Opera RPM...'
	    wget http://www.opera.com/download/get.pl?id=31809&location=72&nothanks=yes&sub=marine
	else
	    echo "Opera RPM already exists. Using '$FILE'."
	fi
	
	rpm -Uvh $FILE
    else
	echo 'Already instaled. Skipping.'
    fi
}

#############################################################################
# Multimedia Codecs - Using GStreamer.

function codecs () {

    echo -e "\n##################################################"
    echo -e "# Video/Audio Codecs\n"

    RPMS="gstreamer-plugins-base gstreamer-plugins-good gstreamer-plugins-farsight gstreamer-plugins-flumpegdemux gstreamer-plugins-bad gstreamer-plugins-ugly"
    _install "$RPMS"
}

############################################################################
# MS Truetype Fonts http://corefonts.sourceforge.net/

function ms_tt_fonts {

    echo -e "\n##################################################"
    echo -e "# MS TrueType Fonts\n"

    if ! rpm --quiet -q rpm-build cabextract ttmkfdir; then
	echo 'Installing needed packages...'
        yum -d $yum_debug -y install rpm-build cabextract ttmkfdir
    fi

    if [ ! -d /usr/share/fonts/msttcorefonts ]; then

	MSTTF_FILE='msttcorefonts-2.0-1.spec'
	
	if [ ! -f $MSTTF_FILE ]; then
	    wget -c http://corefonts.sourceforge.net/$MSTTF_FILE
 	fi
	
	if [ ! -f $MSTTF_FILE ] || [ "$MSTTF_FILE" == "" ]; then
	    echo 'You need to download the latest version of msttcorefonts'
	    echo 'http://corefonts.sourceforge.net/'
	    echo 'and save it in this folder.'
	    echo 'Run this script again after you do so...'
	else
            rpmbuild -bb msttcorefonts-2.0-1.spec
            rpm -Uvh --nodeps /root/rpmbuild/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm
            ln -s /usr/share/fonts/msttcorefonts /etc/X11/fontpath.d/
        fi
    else
	echo 'Already instaled...'
    fi
}

############################################################################
# Google Earth http://earth.google.com/download-earth.html

function google_earth {

    echo -e "\n##################################################"
    echo -e "# Google Earth\n"
    
    if [ ! -f /usr/local/bin/googleearth ]; then
	
        if [ -z "$DISPLAY" ]; then
            echo "You don't seem to be running an X server (no DISPLAY set)."
            echo "Google Earth and its installer both require X11."
            echo "Aborting..."
            return
        fi
	
	GOOGLE_EARTH_FILE='GoogleEarthLinux.bin'
	
	if [ ! -f $GOOGLE_EARTH_FILE ]; then
	    wget -c http://dl.google.com/earth/client/current/$GOOGLE_EARTH_FILE
	fi
	
	if [ ! -f $GOOGLE_EARTH_FILE ] || [ "$GOOGLE_EARTH_FILE" == "" ]; then
	    echo 'You need to download the latest version of Google Earth'
	    echo 'http://earth.google.com/download-earth.html'
	    echo 'and save it in this folder.'
	    echo 'Run this script again after you do so...'
	else
	    sh $GOOGLE_EARTH_FILE
        fi
    else
	echo 'Already instaled...'
    fi
}

############################################################################
# Google Desktop http://desktop.google.com/en/linux/index.html

function google_desktop {

    echo -e "\n##################################################"
    echo -e "# Google Desktop\n"

    if [ ! -f /etc/yum.repos.d/google.repo ]; then
	echo 'Google repository not installed. Install repos first.'
        echo 'Aborting...'
        return
    fi
    
    if ! rpm --quiet -q google-desktop-linux; then
	yum -d $yum_debug -y --enablerepo=google install google-desktop-linux
    else
	echo 'Already instaled...'
    fi
}

############################################################################
# Picasa http://picasa.google.com/linux/

function google_picasa {

    echo -e "\n##################################################"
    echo -e "# Google Picasa\n"

    if [ ! -f /etc/yum.repos.d/google.repo ]; then
	echo 'Google repository not installed. Install repos first.'
        echo 'Aborting...'
        return
    fi
    
    if ! rpm --quiet -q picasa; then
	yum -d $yum_debug -y --enablerepo=google install picasa
    else
	echo 'Already instaled...'
    fi
}

############################################################################
## Google Desktop Integration

function google_integration {

    RPMS="libopensync-plugin-google-calendar online-desktop-google-calendar online-desktop-google-reader online-desktop-google-docs"
    _install "$RPMS"
}

############################################################################
## Just run all at once

function all_in_one () {

    update
    sys_repos
    sys_selinux
    sys_autofsck
    sys_services
    sys_logrotate
    sys_yum_updatesd
    sys_misc
    extras
    flash_player
    acrobat_reader
    opera
    codecs
    ms_tt_fonts
    google_earth
    google_desktop
    google_picasa
}

#############################################################################
##Just install system options

function system_options () {

    sys_repos
    sys_selinux
    sys_autofsck
    sys_services
    sys_logrotate
    sys_yum_updatesd
    sys_misc
}

#############################################################################
## Main loop

declare -i opc=0

while (($opc != 100)); do
    
    # Flash Player
    if [ ! -f /etc/yum.repos.d/adobe-linux-i386.repo ]; then
        FLASH_MSG='Not OK. Install aditional repos first'
    else
	if [ ! -f /usr/lib/flash-plugin/libflashplayer.so ]; then
	    FLASH_MSG='Not installed.'
	else
	    FLASH_MSG='Already installed.'
	fi
    fi
    
    # Acrobar Reader
    if [ -f /usr/bin/acroread ]; then
	ACROBAT_MSG='Already installed.'
    else
	ACROBAT_MSG='Not installed.'
    fi
    
    # Opera
    if [ -f /usr/bin/opera ]; then
        OPERA_MSG='Already installed.'
    else
        OPERA_MSG='Not installed.'
    fi
    
    if [ -f /usr/lib/gstreamer-*/libgstlame.so ]; then
        CODECS_MSG='Already installed.'
    else
    	CODECS_MSG='Not installed.'
    fi

    if [ -d /usr/share/fonts/msttcorefonts ]; then
	MSTTF_MSG='Already installed.'
    else
    	MSTTF_MSG='Not installed.'
    fi
    
    if [ -f /usr/local/bin/googleearth ]; then
	GOOGLE_EARTH_MSG='Already installed.'
    else
    	GOOGLE_EARTH_MSG='Not installed.'
    fi
    
    if [ ! -f /etc/yum.repos.d/google.repo ]; then
	GOOGLE_DESKTOP_MSG='Not OK. Install aditional repos first'
    else
        if rpm --quiet -q google-desktop-linux; then
	    GOOGLE_DESKTOP_MSG='Already installed.'
        else
    	    GOOGLE_DESKTOP_MSG='Not installed.'
        fi
    fi
    
    if [ ! -f /etc/yum.repos.d/google.repo ]; then
	PICASA_MSG='Not OK. Install aditional repos first'
    else
        if rpm --quiet -q picasa; then
	    PICASA_MSG='Already installed.'
        else
    	    PICASA_MSG='Not installed.'
        fi
    fi

    if rpm --quiet -q online-desktop-google-calendar online-desktop-google-reader online-desktop-google-docs; then
	GOOGLE_INTEGRATION_MSG='Already installed.'
    else
    	GOOGLE_INTEGRATION_MSG='Not installed.'
    fi
    
    clear
    echo "VERSION: $SCRIPT_VERSION, DISTRO: $SCRIPT_DISTRO


  # System related configuration. (Select options in numerical order)

  101- Update this host                 (Update your packages 'yum update')
  102- Install additional repos         (Only repos safe to use with the Fedora)
  103- Disable SELINUX                  (Desktops don't really need this)
  104- Enable AUTO FSCK on startup      (Check your disks after a cold reboot)
  105- Reconfigure host services        (Turn off idiotic services that are on by default)
  106- Enable logs compression
  107- Enable automatic updates         (No user intervention in the updates)
  108- Miscellaneous configs            (IPV6, ssh, kernel)
  109- Install additional software      (The good stuff!!! Video, Audio, DVD, etc)

  # Free as in 'Free beer' software!!! (NOT FREE! GRATIS!)

  210- Flash Player                     ($FLASH_MSG)
  211- Acrobat Reader                   ($ACROBAT_MSG)
  213- Opera                            ($OPERA_MSG)
  214- Video/Audio Codecs               ($CODECS_MSG)
  215- MS TrueType Fonts                ($MSTTF_MSG)
  217- Google Earth                     ($GOOGLE_EARTH_MSG)
  218- Google Desktop                   ($GOOGLE_DESKTOP_MSG)
  219- Google Picasa                    ($PICASA_MSG)
  220- Google Desktop Integration       ($GOOGLE_INTEGRATION_MSG)

  500- Install all. Run all option without user intervention.
  501- Execute system configuration options: 102 to 108.

  100- Exit
"

    echo -n 'Insert option: '
    read opc
    
    case  "$opc" in
	
        100) 
            echo 'Exiting...'
            ;;
	
	101)
	    update
	    ;;
	
	102)
	    sys_repos
	    ;;
	
        103)
            sys_selinux
            ;;
	
	104)
	    sys_autofsck
	    ;;
	
	105)
	    sys_services
	    ;;
	
	106)
	    sys_logrotate
	    ;;
	
	107)
	    sys_yum_updatesd
	    ;;
	
	108)
	    sys_misc
	    ;;
	
	109)
	    extras
	    ;;
	
	210)
	    flash_player
	    ;;
	
	211)
	    acrobat_reader
	    ;;
	
   	213)
	    opera
	    ;;
	
	214)
	    codecs
	    ;;
	
	215)
	    ms_tt_fonts
	    ;;
	
        217)
            google_earth
            ;;
	
        218)
            google_desktop
            ;;
	
        219)
            google_picasa
            ;;

	220)
	    google_integration
	    ;;
	
	500)
	    all_in_one
	    ;;
	
	501)
	    system_options
	    ;;
	
        *)
            echo 'Invalid option'
            read tmp
            ;;
        
    esac 
    
    if [ "$opc" != 100 ]; then
	echo 'Done! Press Enter to continue.'
	read tmp
    fi

done
